<template>
  <div class="title-main-box" :style="{ padding }">
    <div class="title-content-box hdty-elip" :style="{ fontSize }" :title="title">
      {{ title }}
    </div>
    <div class="detail" v-show="moreTitle" @click="handleDetail">{{ moreTitle }}</div>
  </div>
</template>

<script>
export default {
  name: '',
  props: {
    title: {
      type: String,
      default: '标题'
    },
    padding: {
      type: String,
      default: '4px 4px 4px 70px'
    },
    fontSize: {
      type: String,
      default: '16px'
    },
    moreTitle: {
      type: String,
      default: ''
    }
  },
  methods: {
    handleDetail() {
      this.$emit('handleDetail')
    }
  }
}
</script>

<style lang="scss" scoped>
.title-main-box {
  //width: 100%;
  height: 15px;
  color: #fff;
  background: url(./images/bg1.png) no-repeat;
  background-size: auto 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;

  .title-content-box {
    line-height: 1;
    color: #02162c;
    font-weight: 600;
  }

  .detail {
    line-height: 1;
    user-select: none;
    cursor: pointer;
  }
}
</style>
